package com.j283_5.wisdom_park.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.j283_5.wisdom_park.pojo.Device;
import com.j283_5.wisdom_park.pojo.Warning;
import com.j283_5.wisdom_park.pojo.WarningDelivery;
import com.j283_5.wisdom_park.pojo.WarningRecord;
import com.j283_5.wisdom_park.vo.warning_management.WarningDeliveryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author laoda
 * @since 2022-04-28
 */
@Mapper
public interface WarningRecordMapper extends BaseMapper<WarningRecord> {
    /**
     * 根据搜索栏模糊搜索预警记录
     * @param warning
     * @return
     */
    List<Warning> queryWarningSum(@Param("warning") Warning warning,
                                  @Param("start")
                                          Integer start,
                                  @Param("limit")
                                          Integer limit,
                                  @Param("oneAdminId")
                                          Integer adminId);

    /**
     * 根据搜索栏模糊查询所有数据的条数
     * @return
     */
    Integer queryWarningCount(@Param("warning") Warning warning,
                              @Param("oneAdminId")
                                      Integer adminId);

//    /**
//     * 查询预警详细信息
//     * @return
//     */
//    WarningDelivery queryDevice(@Param("wrecId")Integer wrecId);

    /**
     * 根据list集合批量删除信息
     * @param warningIdList
     * @return
     */
    Integer deleteWarning(@Param("warningIdList") ArrayList warningIdList);

    /**
     * 根据预警详情id查询需要派单预警的所有信息
     * @param wrecId
     * @return
     */
    WarningDelivery queryWarningDelivery(@Param("wrecId") Integer wrecId);

    /**
     * 通过管理员id进行预警派送
     * @param wrecId
     * @param adminId
     * @return
     */
    Integer warningDelivery(@Param("wrecId") Integer wrecId, @Param("adminId") Integer adminId);

    /**
     * 添加预警信息
     * @param dinfId
     * @param warningDelivery
     * @return
     */
    Integer addWarningDelivery(@Param("dinfId") Integer dinfId, @Param("warningDelivery") WarningDelivery warningDelivery);

    /**
     * 维护设备
     * @param warningDelivery
     * @return
     */
    Integer updateWarningDelivery(@Param("warningDelivery") WarningDelivery warningDelivery);
}
